import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 07 - 26
 * Time: 16:19
 */
//牛客 首页 > 试题广场 > 旧键盘 (20)
public class Solution4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String s1 = in.nextLine();
            String s2 = in.nextLine();
            main1(s1, s2);
        }
    }
    private static void main1(String s1, String s2) {
        Set<Character> set1 = new HashSet<>();
        for (char ch : s2.toUpperCase().toCharArray()) {
            set1.add(ch);
        }
        Set<Character> set2 = new HashSet<>();
        for (char ch : s1.toUpperCase().toCharArray()) {
            if(!set1.contains(ch) && !set2.contains(ch)) {
                System.out.print(ch);
                set2.add(ch);
            }
        }
    }
}
